
package kaizone.haining.chaobohui.json;

import org.json.JSONObject;

public class UserDO extends JSONResponse {

    private UserRegister data;

    public UserRegister getData() {
        return data;
    }

    public void setData(UserRegister data) {
        this.data = data;
    }

    public static UserDO parseJson(String str) {
        UserDO userDO = new UserDO();
        try {
            JSONObject jsonObject = new JSONObject(str);
            JSONResponse response = JSONResponse.parse(jsonObject);
            userDO.setJSONResponse(response);

            JSONObject jsondata = jsonObject.optJSONObject(JSONResponse.DATA);
            if (jsondata != null) {
                UserRegister register = UserRegister.parse(jsondata);
                userDO.setData(register);
            }
            return userDO;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return userDO;
    }
}
